import request from '@/utils/request'


export const loginApi={
  login(username,password) {
    return request({
      url: 'login',
      method: 'post',
      params:{username,password}
    })
  },
}

export function loginByUsername(username, password) {
  const data = {
    username,
    password
  }
  return request({
    url: '/login/login',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/login/logout',
    method: 'post'
  })
}

export function getUserInfo(token) {
  return request({
    url: '/user/info',
    method: 'get',
    params: { token }
  })
}

